Optimal. Leaf size=151 \[ \frac{(A+B) (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1}}{f g (p+1)}-\frac{B 2^{\frac{1}{2}-\frac{p}{2}} (1-\sin (e+f x))^{\frac{p+1}{2}} (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1} \, _2F_1\left (\frac{p+1}{2},\frac{p+1}{2};\frac{p+3}{2};\frac{1}{2} (\sin (e+f x)+1)\right )}{f g (p+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.264259, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2859, 2689, 70, 69} \[ \frac{(A+B) (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1}}{f g (p+1)}-\frac{B 2^{\frac{1}{2}-\frac{p}{2}} (1-\sin (e+f x))^{\frac{p+1}{2}} (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1} \, _2F_1\left (\frac{p+1}{2},\frac{p+1}{2};\frac{p+3}{2};\frac{1}{2} (\sin (e+f x)+1)\right )}{f g (p+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2859
Rule 2689
Rule 70
Rule 69
Rubi steps
\begin{align*} \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-1-p} \, dx &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{f g (1+p)}-\frac{B \int (g \cos (e+f x))^p (c-c \sin (e+f x))^{-p} \, dx}{c}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{f g (1+p)}-\frac{\left (B c (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{\frac{1}{2} (-1-p)} (c+c \sin (e+f x))^{\frac{1}{2} (-1-p)}\right ) \operatorname{Subst}\left (\int (c-c x)^{\frac{1}{2} (-1+p)-p} (c+c x)^{\frac{1}{2} (-1+p)} \, dx,x,\sin (e+f x)\right )}{f g}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{f g (1+p)}-\frac{\left (2^{-\frac{1}{2}-\frac{p}{2}} B c (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-\frac{1}{2}+\frac{1}{2} (-1-p)-\frac{p}{2}} \left (\frac{c-c \sin (e+f x)}{c}\right )^{\frac{1}{2}+\frac{p}{2}} (c+c \sin (e+f x))^{\frac{1}{2} (-1-p)}\right ) \operatorname{Subst}\left (\int \left (\frac{1}{2}-\frac{x}{2}\right )^{\frac{1}{2} (-1+p)-p} (c+c x)^{\frac{1}{2} (-1+p)} \, dx,x,\sin (e+f x)\right )}{f g}\\ &=\frac{(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{f g (1+p)}-\frac{2^{\frac{1}{2}-\frac{p}{2}} B (g \cos (e+f x))^{1+p} \, _2F_1\left (\frac{1+p}{2},\frac{1+p}{2};\frac{3+p}{2};\frac{1}{2} (1+\sin (e+f x))\right ) (1-\sin (e+f x))^{\frac{1+p}{2}} (c-c \sin (e+f x))^{-1-p}}{f g (1+p)}\\ \end{align*}
Mathematica [C] time = 3.44466, size = 300, normalized size = 1.99 \[ -\frac{2^{-p} (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^p \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )^{-2 (-p-1)-2 p} \left (\frac{1-\tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{\frac{1}{\cos (e+f x)+1}}}\right )^{2 p} \left (\frac{1-\tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{\sec ^2\left (\frac{1}{2} (e+f x)\right )}}\right )^{-2 p} \left (p (A+B) \left (\tan \left (\frac{1}{2} (e+f x)\right )+1\right )-i B (p+1) \left (\tan \left (\frac{1}{2} (e+f x)\right )-1\right ) \, _2F_1\left (1,-p;1-p;-\frac{i \left (\tan \left (\frac{1}{2} (e+f x)\right )-1\right )}{\tan \left (\frac{1}{2} (e+f x)\right )+1}\right )+i B (p+1) \left (\tan \left (\frac{1}{2} (e+f x)\right )-1\right ) \, _2F_1\left (1,-p;1-p;\frac{i \left (\tan \left (\frac{1}{2} (e+f x)\right )-1\right )}{\tan \left (\frac{1}{2} (e+f x)\right )+1}\right )\right )}{f p (p+1) \left (\tan \left (\frac{1}{2} (e+f x)\right )-1\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.432, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{p} \left ( A+B\sin \left ( fx+e \right ) \right ) \left ( c-c\sin \left ( fx+e \right ) \right ) ^{-1-p}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 1}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]